import request from '@/utils/request';
import qs from "qs";

export async function queryRule(params) {
  const limit = params.pageSize;
  const page = params.current;
  const my_params = {
    limit: limit,
    page: page,
  };
  Object.assign(params, my_params);
  delete params.current;
  delete params.pageSize;
    return request('/supplyChain/warehouseStockCheck/page', {
      params:params,
      paramsSerializer: params => {
        return qs.stringify(params, { indices: false })
      }
    });
}
export async function queryStore(params) {
  return request('store/store/list', {
    params,
  });
}

export async function exportRecord(params) {
  return request(`/supplyChain/warehouseStockCheck/export`, {
    method: 'GET',
    responseType: 'blob',
    params:params,
    paramsSerializer: params => {
      return qs.stringify(params, { indices: false })
    }
  });
}
export async function removeRule(id) {
  return request(`/supplyChain/warehouseStockCheck/${id}`, {
    method: 'DELETE',
    data: {},
  });
}
export async function exportCheck(params) {
  return request(`/supplyChain/stockCheck/exportCheck`, {
    method: 'GET',
    responseType: 'blob',
    params:params,
    paramsSerializer: params => {
      return qs.stringify(params, { indices: false })
    }
  });
}
export async function endCheck(data) {
  return request(`/supplyChain/warehouseStockCheck/end`, {
    method: 'POST',
    data,
  });
}
